package cn.hs.controller;

import cn.hs.entity.Specialty;
import cn.hs.service.SpecialtyService;
import cn.hs.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName SpecialtyController
 * @Description TODO
 * @Author yyk
 * @Date 2024年10月24日 19:27
 * @Version 1.0
 */

@RestController
@RequestMapping("/SpecialtyController")
public class SpecialtyController {
    @Autowired
    private SpecialtyService specialtyService;
    @GetMapping("/findBysId")
    public Result findBysId(@RequestParam(value = "sid") int sid) {
        List<Specialty> bysId = specialtyService.findBysId(sid);
        if (bysId != null && bysId.size() > 0) {
            return Result.success(bysId);
        }else {
            return Result.error();
        }
    }





}
